<?php
$_s[0] = 0;
$_s[1] = $setting['point_1'];
$_s[2] = $setting['point_2'];
$_s[3] = $setting['point_3'];
$_s[4] = $setting['point_4'];
$_s[5] = $setting['point_5'];

$star_full = 0;
$star_half = 0;

for($i=1;$i<=5;$i++){
    if($_SESSION['point']>=$_s[$i]){
        $star_full = $i;
    }
}
if($star_full<5){
   $tmp = ($_SESSION['point']-$_s[$star_full])*100/($_s[$star_full+1]-$_s[$star_full]);
   if($tmp>=40) {
        $star_half = 1;
   }
}

$star_empty = 5 - $star_half - $star_full;

for($i=1;$i<=$star_full;$i++){?><i class="fa fa-star"></i><?php }?><?php if($star_half){?><i class="fa fa-star-half-o"></i><?php }?><?php for($i=1;$i<=$star_empty;$i++){?><i class="fa fa-star-o"></i><?php }